package com.tbb.app.base.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tbb.app.base.entity.Channel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "频道VO")
public class ChannelVO {

    @ApiModelProperty("id，注意不是序号")
    private String id;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty("名称")
    private String name;

    public ChannelVO(Channel c) {
        this.id = c.getId();
        this.createTime = c.getCreateTime();
        this.updateTime = c.getUpdateTime();
        this.name = c.getName();
    }

}
